import Vue from "vue";
import Vuex from 'vuex';
Vue.use(Vuex)

import home from './modules/home'
import search from "./modules/search";
import detail from "./modules/detail";
import cart from "./modules/cart";
import user from './modules/user'
import trade from './modules/trade'
import child1 from './modules/child1'
import child2 from './modules/child2'


export default new Vuex.Store({
   state : {
    count : 2
  
  },
  
   mutations : {
    ADD(state) {
      state.count++
    }
   },
  
  
   actions : {
    increment({ commit }) {
      commit('ADD')
    }
   },
  
   getters : {
    tenflod(state) {
      return state.count * 10
    }
   },

  //模块化
  modules: {
    user,
    cart,
    home,
    search,
    detail,
    trade,
    child1,
    child2
  }
})